package com.zl.data.manger;

import android.content.Context;
import android.content.Intent;
import com.zl.data.service.DataMangerService;


/**
 * @author ZL @朱林</a>
 * @Version 1.0
 * @Description TODO
 * @date 2021/01/11  18:08
 */
public class DataServiceManger {
    public static void init(Context mContext) {
        Intent mIntent = new Intent(mContext, DataMangerService.class);
        mContext.startService(mIntent);
        DataMangerService.setContext(mContext);
    }

    public static boolean encode(String key, String value) {
        return DataMangerService.encode(key, value.getBytes());
    }

    public static String decodeString(String key) {
        byte[] value = DataMangerService.decodeBytes(key);
        if (null != value && value.length > 0) {
            return new String(value);
        } else {
            return null;
        }
    }


}
